# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Justin Davis (juster) <jrcd83@gmail.com>

pkgname=perl-async-interrupt
_ver=1.21
pkgver=1.21
pkgrel=6
pkgdesc='allow C/XS libraries to interrupt perl asynchronously'
arch=(i686 x86_64)
license=(PerlArtistic GPL)
options=(!emptydirs)
depends=(perl-common-sense)
url=https://metacpan.org/release/Async-Interrupt
source=("http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/Async-Interrupt-$_ver.tar.gz")
sha512sums=('c8376e00f234398dbbe2eb9ddeeed0a083b1218e8f142b59979647c7c91606a7e7a279301cdf0624ffbf8b81a87404f34700429c02efc5ab815c1d49cb2f1bd9')

build() {
  cd "$srcdir/Async-Interrupt-$_ver"
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  unset PERL5LIB PERL_MM_OPT
  /usr/bin/perl Makefile.PL
  make
}

check() {
  cd "$srcdir/Async-Interrupt-$_ver"
  export PERL_MM_USE_DEFAULT=1
  unset PERL5LIB
  make test
}

package() {
  cd "$srcdir/Async-Interrupt-$_ver"
  make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}

# Local Variables:
# mode: shell-script
# sh-basic-offset: 2
# End:
# vim:set ts=2 sw=2 et:
